﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NetCore.Code.Model
{
    public partial class DbServerEntity
    {
        public virtual string parent { get; set; }
        public virtual string id
        {
            get
            {
                return DbServerId.ToString()+"_S";
            }
        }
        public virtual string SourceId
        {
            get
            {
                return DbServerId.ToString();
            }
        }
        public virtual int DbServerType
        {
            get
            {
                return 0;
            }
        }
      
        public virtual string text
        {
            get
            {
                return LocalName;
            }
        }
        private  object[] mchildren;
        /// <summary>
        /// 
        /// </summary>
        public virtual object[] children
        {
            get {
                if (mchildren != null)
                {
                    return mchildren;
                }
                return new object[] {
                    new { text = "表", id = DbServerId.ToString() + "_T",icon="fa fa-table",parent=this.id, SourceId = DbServerId.ToString(), DbServerType = 1, action = "T", children = true },
                    new { text = "视图", SourceId = DbServerId.ToString(),icon="fa fa-table",parent=this.id, id = DbServerId.ToString() + "_V", DbServerType = 1, action = "V", children = true } };
            }
            set {
                mchildren = value;
            }
        }
        public virtual string icon { get => "fa fa-database"; }
        /// <summary>
        /// 下级路径
        /// </summary>
        public virtual string action
        {
            get
            {
                return "GetTreeTable";
            }
        }
    }
}
